<?

	if(!session_is_registered('login')) {
		 echo "<p>Vous devez être enregistré pour accéder à cette page !</P>";
	 } else {	 
		 
	if(isset($_GET['action'])) {		
		if($_GET['action'] == "add_presse") {
			$titre = $_POST['titre'];
			$url = $_POST['url'];
			
			$result = mysql_query("INSERT INTO `presse`(`id`, `titre`,`url`) VALUES ('', \"".$titre."\", '".$url."')");
		
			if (!$result) {
	   			die('Requête invalide : ' . mysql_error());
			}
		}
	}
?>

<TABLE WIDTH=100%>
<TD align="center">
<TABLE WIDTH=749 BORDER=0 CELLPADDING=0 CELLSPACING=0>
	<TR>
		<TD><IMG SRC="images/articles_01.gif" WIDTH=12 HEIGHT=22 ALT=""></TD>
		<TD background="images/articles_02.gif" WIDTH=725 HEIGHT=22><B>Ajouter un article de presse</B></TD>
		<TD><IMG SRC="images/articles_03.gif" WIDTH=12 HEIGHT=22 ALT=""></TD>
	</TR>
	<TR>
		<TD><IMG SRC="images/articles_04.gif" WIDTH=12 HEIGHT=12 ALT=""></TD>
		<TD><IMG SRC="images/articles_05.gif" WIDTH=725 HEIGHT=12 ALT=""></TD>
		<TD><IMG SRC="images/articles_06.gif" WIDTH=12 HEIGHT=12 ALT=""></TD>
	</TR>
	<TR>
		<TD background="images/articles_07.gif" WIDTH=12></TD>
		<TD WIDTH=725 background="images/articles_08.gif">

			<FORM method="POST" action="index.php?page=add_presse&action=add_presse">
				<TABLE WIDTH="100%">
				<TR>
					<TD WIDTH="20%" valign="top"><B>Titre :</B></TD>
					<TD><INPUT TYPE="text" NAME="titre" SIZE="40"></TD>
				</TR>
				<TR>
					<TD WIDTH="20%" valign="top"><B>URL :</B></TD>
					<TD><INPUT TYPE="text" NAME="url" SIZE="40"></TD>
				</TR>
				<TR><TD colspan=2 align="center">
				<BR><INPUT TYPE="Submit" Value="Poster"><BR><BR>
				</TD></TR>
				</TABLE>
			</FORM>

		</TD>
		<TD background="images/articles_09.gif" WIDTH=12></TD>
	</TR>
	<TR>
		<TD><IMG SRC="images/articles_10.gif" WIDTH=12 HEIGHT=21 ALT=""></TD>
		<TD background="images/articles_11.gif" WIDTH=725 HEIGHT=21 valign="center" align="right">
		</TD>
		<TD><IMG SRC="images/articles_12.gif" WIDTH=12 HEIGHT=21 ALT=""></TD>
	</TR>
</TABLE>
</TD>
</TABLE>
<? } ?>	